package com.library.librarybackend.service;

import com.library.librarybackend.domain.ResponseWithPage;
import com.library.librarybackend.domain.dto.BookEditFormDTO;
import com.library.librarybackend.domain.dto.BookQueryDTO;
import com.library.librarybackend.domain.dto.BookUploadFormDTO;
import com.library.librarybackend.domain.entity.Book;
import com.baomidou.mybatisplus.extension.service.IService;
import com.library.librarybackend.domain.vo.BookVO;

import java.io.InputStream;

/**
 * @author MR
 * @description 针对表【book(书籍表)】的数据库操作Service
 * @createDate 2025-09-21 15:06:48
 */
public interface BookService extends IService<Book> {

    /**
     * 上传书籍
     *
     * @param bookUploadFormDTO 上传书籍参数
     * @return 书籍信息
     */
    BookVO upload(BookUploadFormDTO bookUploadFormDTO);

    /**
     * 查询书籍
     *
     * @param bookQueryDTO 查询参数
     * @return 书籍列表
     */
    ResponseWithPage<BookVO> queryPage(BookQueryDTO bookQueryDTO);

    /**
     * 下载书籍
     *
     * @param id      书籍id
     * @param objName 附件名称
     * @return 附件
     */
    InputStream download(Long id, String objName);
}
